import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';


export interface Person {
  key: string;
  name: string;
  subscibe: string;
  time: string;
}
@Component({
  selector: 'app-record',
  templateUrl: './record.component.html',
  styleUrls: ['./record.component.less']
})

export class RecordComponent implements OnInit {
  constructor(private fb: FormBuilder) { }

  index_form!: FormGroup
  listOfData: Person[] = [];
  indexFormSubmit(): void {
    if (this.index_form.value)
      console.log(this.index_form.value)
  }
  
  ngOnInit(): void {
    this.index_form = this.fb.group({
      line: [null],
      date: [null],
      cycle: ["day"]
    })

    for (let i = 0; i < 50; i++) {
      this.listOfData.push({
          key: i.toString(),
          name: '张工' + i,
          subscibe: '日常维护',
          time: new Date().toLocaleString()
      })
  }
  }


  onOptionTdClick(data) {

    console.log(data)
}

}

